home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6203 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.tau.ac.il!usenet
  2. From: "Avi L." <avil@sapiens.com>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: scramble game algorithm?
  5. Date: Tue, 26 Mar 1996 11:06:16 +0200
  6. Organization: Sapiens Tech.
  7. Message-ID: <3157B388.3F20@sapiens.com>
  8. NNTP-Posting-Host: honda.sapiens.co.il
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.01 (WinNT; I)
  13.  
  14. Hi there, i'm trying to figure out an algorithm for solving the 
  15. famous scramble game, i've succeeded in solving most of the game 
  16. however there are situations which require more logic added in 
  17. order to search for a better path to move the pieces around. my 
  18. algorithm simply takes each piece at a time starting from the 
  19. lowest numbered one and tries to bring it to its final position, 
  20. however sometimes it needs to go over pieces which have already 
  21. been positioned and so the problem is choosing the best path to 
  22. move the pieces and then get them back to thier proper places.
  23. especially the following situation is troublesome:
  24.  
  25. 1 2 3 4 
  26. 5 6 7 8 
  27. 9 10 11 12
  28. 14 15 13 -1.
  29.  
  30. -1 == empty space.
  31. how do you get the 13 piece to its proper place and then manage 
  32. to get the other pieces back to thier original position and thus 
  33. solve this damn game. 
  34. i know how to solve the game by hand however translating 
  35. it to software code isn't so straight forward. guess 
  36. life's too complex for that, eh?! 
  37. thank you in advance for any information.
  38.  
  39. Avi Lev.
  40.